<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <style>
        thead tr th{text-align: center!important;}
        tr td{text-align: center!important;}
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
            	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
					<div class="layui-form-item">
						<div class="test-table-reload-btn layui-col-sm-offset3" style="margin-bottom: 10px;">
                        	<div class="layui-col-sm1" style="line-height: 38px">时间范围：</div>
                        	<div class="layui-col-sm3">
                            	<input class="layui-input" name="queryTime" id="laydate-cn" autocomplete="off">
                        	</div>
                        	<div class="layui-inline">
								<button class="layui-btn layuiadmin-btn-list" lay-submit
									lay-filter="LAY-app-contlist-search">
									<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
								</button>
							</div>
                    	</div>
					</div>
				</div>
                <div class="layui-card-body">
                    <table class="layui-table" lay-filter="table" id="table"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script src="/js/common.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'laydate', 'table', 'form'], function(){
        var admin = layui.admin, laydate = layui.laydate, table = layui.table,form=layui.form;
        
		table.render({
			elem : '.layui-table',
			url : '/base/queryLogsList',
			page:true,
			request: {
				pageName: 'current', //页码的参数名称，默认：page
				limitName: 'size' //每页数据量的参数名，默认：limit
			},
			cols : [[ 
				{field : 'loginAccount', title:'操作账号|角色'},
				{field : 'loginIp', title:'IP'},
				{field : 'actionUrl', title : '请求的链接'},
				{field : 'module', title : '执行的模块'},
				{field : 'method', title : '执行的方法'},
				{field : 'actionTime', title : '执行时间(毫秒)'},
				{field : 'description', title : '描述'},
				{field : 'createtime', title:'操作时间', 
					templet : function(row){
						return createTime(row.createtime);
					}
				}
			]],
			skin : "row",
			even: true,
			size:"lg"
		});
		
		var today = new Date();
        var last = today.getFullYear() + "-" + today.getMonth() + "-" +today.getDate();
        today = today.getFullYear() + "-" + (today.getMonth()+1) + "-" +today.getDate();
        laydate.render({
            elem: '#laydate-cn',
            range:'~',
            max:today
    	});
		
		//监听搜索
	    form.on('submit(LAY-app-contlist-search)', function(data){
	      var field = data.field;
	      
	      //执行重载
	      table.reload('table', {
	        where: field
	      });
	    });
    });

</script>
</body>
</html>